Optimal. Leaf size=130 \[ \frac {3 b \left (4 a^2+b^2\right ) \tanh ^{-1}(\sin (c+d x))}{8 d}+\frac {a \left (a^2+4 b^2\right ) \tan (c+d x)}{2 d}+\frac {b \left (2 a^2+3 b^2\right ) \sec (c+d x) \tan (c+d x)}{8 d}+\frac {a (a+b \sec (c+d x))^2 \tan (c+d x)}{4 d}+\frac {(a+b \sec (c+d x))^3 \tan (c+d x)}{4 d} \]
[Out]
________________________________________________________________________________________
Rubi [A]
time = 0.14, antiderivative size = 130, normalized size of antiderivative = 1.00, number of steps
used = 7, number of rules used = 7, integrand size = 21, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.333, Rules used = {3920, 4087,
4082, 3872, 3855, 3852, 8} \begin {gather*} \frac {a \left (a^2+4 b^2\right ) \tan (c+d x)}{2 d}+\frac {3 b \left (4 a^2+b^2\right ) \tanh ^{-1}(\sin (c+d x))}{8 d}+\frac {b \left (2 a^2+3 b^2\right ) \tan (c+d x) \sec (c+d x)}{8 d}+\frac {\tan (c+d x) (a+b \sec (c+d x))^3}{4 d}+\frac {a \tan (c+d x) (a+b \sec (c+d x))^2}{4 d} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
Rule 8
Rule 3852
Rule 3855
Rule 3872
Rule 3920
Rule 4082
Rule 4087
Rubi steps
\begin {align*} \int \sec ^2(c+d x) (a+b \sec (c+d x))^3 \, dx &=\frac {(a+b \sec (c+d x))^3 \tan (c+d x)}{4 d}+\frac {3}{4} \int \sec (c+d x) (b+a \sec (c+d x)) (a+b \sec (c+d x))^2 \, dx\\ &=\frac {a (a+b \sec (c+d x))^2 \tan (c+d x)}{4 d}+\frac {(a+b \sec (c+d x))^3 \tan (c+d x)}{4 d}+\frac {1}{4} \int \sec (c+d x) (a+b \sec (c+d x)) \left (5 a b+\left (2 a^2+3 b^2\right ) \sec (c+d x)\right ) \, dx\\ &=\frac {b \left (2 a^2+3 b^2\right ) \sec (c+d x) \tan (c+d x)}{8 d}+\frac {a (a+b \sec (c+d x))^2 \tan (c+d x)}{4 d}+\frac {(a+b \sec (c+d x))^3 \tan (c+d x)}{4 d}+\frac {1}{8} \int \sec (c+d x) \left (3 b \left (4 a^2+b^2\right )+4 a \left (a^2+4 b^2\right ) \sec (c+d x)\right ) \, dx\\ &=\frac {b \left (2 a^2+3 b^2\right ) \sec (c+d x) \tan (c+d x)}{8 d}+\frac {a (a+b \sec (c+d x))^2 \tan (c+d x)}{4 d}+\frac {(a+b \sec (c+d x))^3 \tan (c+d x)}{4 d}+\frac {1}{8} \left (3 b \left (4 a^2+b^2\right )\right ) \int \sec (c+d x) \, dx+\frac {1}{2} \left (a \left (a^2+4 b^2\right )\right ) \int \sec ^2(c+d x) \, dx\\ &=\frac {3 b \left (4 a^2+b^2\right ) \tanh ^{-1}(\sin (c+d x))}{8 d}+\frac {b \left (2 a^2+3 b^2\right ) \sec (c+d x) \tan (c+d x)}{8 d}+\frac {a (a+b \sec (c+d x))^2 \tan (c+d x)}{4 d}+\frac {(a+b \sec (c+d x))^3 \tan (c+d x)}{4 d}-\frac {\left (a \left (a^2+4 b^2\right )\right ) \text {Subst}(\int 1 \, dx,x,-\tan (c+d x))}{2 d}\\ &=\frac {3 b \left (4 a^2+b^2\right ) \tanh ^{-1}(\sin (c+d x))}{8 d}+\frac {a \left (a^2+4 b^2\right ) \tan (c+d x)}{2 d}+\frac {b \left (2 a^2+3 b^2\right ) \sec (c+d x) \tan (c+d x)}{8 d}+\frac {a (a+b \sec (c+d x))^2 \tan (c+d x)}{4 d}+\frac {(a+b \sec (c+d x))^3 \tan (c+d x)}{4 d}\\ \end {align*}
________________________________________________________________________________________
Mathematica [A]
time = 0.47, size = 90, normalized size = 0.69 \begin {gather*} \frac {3 b \left (4 a^2+b^2\right ) \tanh ^{-1}(\sin (c+d x))+\tan (c+d x) \left (3 b \left (4 a^2+b^2\right ) \sec (c+d x)+2 b^3 \sec ^3(c+d x)+8 a \left (a^2+3 b^2+b^2 \tan ^2(c+d x)\right )\right )}{8 d} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [A]
time = 0.09, size = 125, normalized size = 0.96
method | result | size |
derivativedivides | \(\frac {a^{3} \tan \left (d x +c \right )+3 b \,a^{2} \left (\frac {\sec \left (d x +c \right ) \tan \left (d x +c \right )}{2}+\frac {\ln \left (\sec \left (d x +c \right )+\tan \left (d x +c \right )\right )}{2}\right )-3 b^{2} a \left (-\frac {2}{3}-\frac {\left (\sec ^{2}\left (d x +c \right )\right )}{3}\right ) \tan \left (d x +c \right )+b^{3} \left (-\left (-\frac {\left (\sec ^{3}\left (d x +c \right )\right )}{4}-\frac {3 \sec \left (d x +c \right )}{8}\right ) \tan \left (d x +c \right )+\frac {3 \ln \left (\sec \left (d x +c \right )+\tan \left (d x +c \right )\right )}{8}\right )}{d}\) | \(125\) |
default | \(\frac {a^{3} \tan \left (d x +c \right )+3 b \,a^{2} \left (\frac {\sec \left (d x +c \right ) \tan \left (d x +c \right )}{2}+\frac {\ln \left (\sec \left (d x +c \right )+\tan \left (d x +c \right )\right )}{2}\right )-3 b^{2} a \left (-\frac {2}{3}-\frac {\left (\sec ^{2}\left (d x +c \right )\right )}{3}\right ) \tan \left (d x +c \right )+b^{3} \left (-\left (-\frac {\left (\sec ^{3}\left (d x +c \right )\right )}{4}-\frac {3 \sec \left (d x +c \right )}{8}\right ) \tan \left (d x +c \right )+\frac {3 \ln \left (\sec \left (d x +c \right )+\tan \left (d x +c \right )\right )}{8}\right )}{d}\) | \(125\) |
norman | \(\frac {-\frac {\left (8 a^{3}-12 b \,a^{2}+24 b^{2} a -5 b^{3}\right ) \left (\tan ^{7}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{4 d}+\frac {\left (8 a^{3}+12 b \,a^{2}+24 b^{2} a +5 b^{3}\right ) \tan \left (\frac {d x}{2}+\frac {c}{2}\right )}{4 d}+\frac {\left (24 a^{3}-12 b \,a^{2}+40 b^{2} a +3 b^{3}\right ) \left (\tan ^{5}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{4 d}-\frac {\left (24 a^{3}+12 b \,a^{2}+40 b^{2} a -3 b^{3}\right ) \left (\tan ^{3}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{4 d}}{\left (\tan ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )-1\right )^{4}}-\frac {3 b \left (4 a^{2}+b^{2}\right ) \ln \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )-1\right )}{8 d}+\frac {3 b \left (4 a^{2}+b^{2}\right ) \ln \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )+1\right )}{8 d}\) | \(227\) |
risch | \(-\frac {i \left (12 b \,a^{2} {\mathrm e}^{7 i \left (d x +c \right )}+3 b^{3} {\mathrm e}^{7 i \left (d x +c \right )}-8 a^{3} {\mathrm e}^{6 i \left (d x +c \right )}+12 a^{2} b \,{\mathrm e}^{5 i \left (d x +c \right )}+11 b^{3} {\mathrm e}^{5 i \left (d x +c \right )}-24 a^{3} {\mathrm e}^{4 i \left (d x +c \right )}-48 a \,b^{2} {\mathrm e}^{4 i \left (d x +c \right )}-12 b \,a^{2} {\mathrm e}^{3 i \left (d x +c \right )}-11 b^{3} {\mathrm e}^{3 i \left (d x +c \right )}-24 a^{3} {\mathrm e}^{2 i \left (d x +c \right )}-64 a \,b^{2} {\mathrm e}^{2 i \left (d x +c \right )}-12 a^{2} b \,{\mathrm e}^{i \left (d x +c \right )}-3 b^{3} {\mathrm e}^{i \left (d x +c \right )}-8 a^{3}-16 b^{2} a \right )}{4 d \left ({\mathrm e}^{2 i \left (d x +c \right )}+1\right )^{4}}-\frac {3 b \ln \left ({\mathrm e}^{i \left (d x +c \right )}-i\right ) a^{2}}{2 d}-\frac {3 b^{3} \ln \left ({\mathrm e}^{i \left (d x +c \right )}-i\right )}{8 d}+\frac {3 b \ln \left ({\mathrm e}^{i \left (d x +c \right )}+i\right ) a^{2}}{2 d}+\frac {3 b^{3} \ln \left ({\mathrm e}^{i \left (d x +c \right )}+i\right )}{8 d}\) | \(307\) |
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [A]
time = 0.26, size = 158, normalized size = 1.22 \begin {gather*} \frac {16 \, {\left (\tan \left (d x + c\right )^{3} + 3 \, \tan \left (d x + c\right )\right )} a b^{2} - b^{3} {\left (\frac {2 \, {\left (3 \, \sin \left (d x + c\right )^{3} - 5 \, \sin \left (d x + c\right )\right )}}{\sin \left (d x + c\right )^{4} - 2 \, \sin \left (d x + c\right )^{2} + 1} - 3 \, \log \left (\sin \left (d x + c\right ) + 1\right ) + 3 \, \log \left (\sin \left (d x + c\right ) - 1\right )\right )} - 12 \, a^{2} b {\left (\frac {2 \, \sin \left (d x + c\right )}{\sin \left (d x + c\right )^{2} - 1} - \log \left (\sin \left (d x + c\right ) + 1\right ) + \log \left (\sin \left (d x + c\right ) - 1\right )\right )} + 16 \, a^{3} \tan \left (d x + c\right )}{16 \, d} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [A]
time = 2.90, size = 140, normalized size = 1.08 \begin {gather*} \frac {3 \, {\left (4 \, a^{2} b + b^{3}\right )} \cos \left (d x + c\right )^{4} \log \left (\sin \left (d x + c\right ) + 1\right ) - 3 \, {\left (4 \, a^{2} b + b^{3}\right )} \cos \left (d x + c\right )^{4} \log \left (-\sin \left (d x + c\right ) + 1\right ) + 2 \, {\left (8 \, a b^{2} \cos \left (d x + c\right ) + 8 \, {\left (a^{3} + 2 \, a b^{2}\right )} \cos \left (d x + c\right )^{3} + 2 \, b^{3} + 3 \, {\left (4 \, a^{2} b + b^{3}\right )} \cos \left (d x + c\right )^{2}\right )} \sin \left (d x + c\right )}{16 \, d \cos \left (d x + c\right )^{4}} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \int \left (a + b \sec {\left (c + d x \right )}\right )^{3} \sec ^{2}{\left (c + d x \right )}\, dx \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [B] Leaf count of result is larger than twice the leaf count of optimal. 330 vs.
\(2 (120) = 240\).
time = 0.50, size = 330, normalized size = 2.54 \begin {gather*} \frac {3 \, {\left (4 \, a^{2} b + b^{3}\right )} \log \left ({\left | \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) + 1 \right |}\right ) - 3 \, {\left (4 \, a^{2} b + b^{3}\right )} \log \left ({\left | \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) - 1 \right |}\right ) - \frac {2 \, {\left (8 \, a^{3} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{7} - 12 \, a^{2} b \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{7} + 24 \, a b^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{7} - 5 \, b^{3} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{7} - 24 \, a^{3} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{5} + 12 \, a^{2} b \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{5} - 40 \, a b^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{5} - 3 \, b^{3} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{5} + 24 \, a^{3} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{3} + 12 \, a^{2} b \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{3} + 40 \, a b^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{3} - 3 \, b^{3} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{3} - 8 \, a^{3} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) - 12 \, a^{2} b \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) - 24 \, a b^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) - 5 \, b^{3} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )\right )}}{{\left (\tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{2} - 1\right )}^{4}}}{8 \, d} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Mupad [B]
time = 4.80, size = 226, normalized size = 1.74 \begin {gather*} \frac {3\,b\,\mathrm {atanh}\left (\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )\right )\,\left (4\,a^2+b^2\right )}{4\,d}-\frac {\left (2\,a^3-3\,a^2\,b+6\,a\,b^2-\frac {5\,b^3}{4}\right )\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^7+\left (-6\,a^3+3\,a^2\,b-10\,a\,b^2-\frac {3\,b^3}{4}\right )\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^5+\left (6\,a^3+3\,a^2\,b+10\,a\,b^2-\frac {3\,b^3}{4}\right )\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^3+\left (-2\,a^3-3\,a^2\,b-6\,a\,b^2-\frac {5\,b^3}{4}\right )\,\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}{d\,\left ({\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^8-4\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^6+6\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^4-4\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^2+1\right )} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________